﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TMPro;
using UnityEngine;

namespace Assets.Scenes.Script.UI
{
    class Btn:MonoBehaviour
    {
        ConfigItem configItem;
        public TextMeshProUGUI text;

        public void Init(ConfigItem configItem)
        {
            this.configItem = configItem;
            text.text = configItem.btnName;
        }

        public void Click()
        {
            if (configItem.psName.Length==0)
            {
                UIManager.Single.output.text = configItem.CMD;
            }
            else
            {
                UIManager.Single.ShowParmPanel(configItem);
            }
        }
    }
}
